<?php
/*
Template Name: Urgent Visa template
 */
?>
<?php get_header(); ?>
<?php get_sidebar(); ?>
<div id="col3">
	<div class="clearfix" id="col3_content">          
		<div id="main_content">
			<div id="main_content_foot">
			<?php
				include 'checkinput.php';
				if($_POST['btnSubmitUrgent']){
					$email = $_REQUEST['primaryemail'];
					$reemail = $_REQUEST['reemail'];
					$secondemail = $_REQUEST['secondaryemail'];
					$fullname = $_REQUEST['fullname'];
					$birth = $_REQUEST['Date_of_Birth'];
					$passport = $_REQUEST['passport'];
					$nationality = $_REQUEST['nationality'];
					$flightdetails = $_REQUEST['flightdetails'];
					$entry = $_REQUEST['Date_of_Entry'];
					$request = $_REQUEST['request'];
					$flag = 1;
					$flagemail = vailemail($email);
					$flagreemail = vailemail($reemail);
					$flagfullname = vailname($fullname);
					$flagbirth = ($birth == ""?-1:1);
					$flagpassport = ($passport == ""?-1:1);
					$flagnationality = ($nationality == ""?-1:1);
					$flagflightdetails = ($flightdetails == ""?-1:1);
					$flagentry = ($entry == ""?-1:1);
					$flagrequest = ($request == ""?-1:1);
					
					$flag=($flagfullname>-1)&&($flagemail>-1)&&($flagreemail>-1)
						&&($flagbirth>-1)&&($flagpassport>-1)&&($flagnationality>-1)
						&&($flagflightdetails>-1)&&($flagentry>-1)&&($flagrequest>-1);
				}
				if($flag>0){
					echo "submit successful";
				}
				else{
					?>
					<div class="contentpaneopen">
                    <div id="application">
                    	<form action="" id="fromApp1" method="post" name="frmAppl" >
                        	<input type="hidden" value="1" name="confirmed" />
                        	<input type="hidden" value="2" name="step" />
                        	<div id="app_form">
                            	<h2><span id="app_form_title">Urgent Visa</span></h2>
                            	<div id="app_form_text">
                                	Please fill the form below and click send if you need express visa for emergency trip to Vietnam. We will reply you at earliest time 24/7. Don't worry if you want to get your visa on Sat or Sun or Public holidy. We know how.<br/>
                            	</div>
                            	<div class="app_form_inner">                                                           
                                	<label class="">Primary Email <span style="color:#FF0000">*</span></label>
                                	<input type="text" class="" value="" name="primaryemail" id="primaryemail" />
                                	<label class="">Re-Type Primary Email <span style="color:#FF0000">*</span></label>
                                	<input type="text" class="" autocomplete="off" onpaste="alert('You cannot directly copy and paste.');this.value='';return false;" value="" name="reemail" id="reemail" />  
                                    <label>Secondary Email (optional)</label>
                                    <input type="text" value="" id="secondaryemail" name="secondaryemail" />            
                                    <label class="">Fullname (as in passport) <span style="color:#FF0000">*</span></label>
                                    <input type="text" class="" value="" id="fullname" name="fullname" />
                                    <label class="set">Date of Birth <span style="color:#FF0000">*</span></label>
                                    <input id="Date_of_Birth" class="DateofbirthMM ccf-datepicker-1 " name="Date_of_Birth" type="text" />
                                    <label>Passport Number <span style="color:#FF0000">*</span></label>      
                                    <input type="text" class="" value="" id="passport" name="passport" />         
                                    <label class="">Nationality <span style="color:#FF0000">*</span></label>
                                    <select class="national" id="nationality" name="nationality">
                                    	<option value="">&nbsp;</option>                                    
                                   	</select>       
                                    <label>Flight Details <span style="color:#FF0000">*</span></label>
                                    <input type="text" class="" value="" id="flightdetails" name="flightdetails" />         
                                    <label class="">Date of entry <span style="color:#FF0000">*</span></label>
                                    <input id="Date_of_Entry" class="DateofentryMM ccf-datepicker-1 " name="Date_of_Entry" type="text" />
                                    <label class="lamessage">Urgent message</label>       
                                    <textarea id="request" name="request"></textarea>        
                            	</div>
                                <div class="submit_form">
                                    <input type="submit" onclick="submitForm(1);" value="Submit &gt;&gt;" name="btnSubmitUrgent" class="button">
                                </div> 
                        	</div>
                        </form>
                        <div id="urgent_frame">
                        	<p>
                            	<em>
                                	<strong>Why we don't accept call for your visa?</strong>
                           		</em>
                        	</p>
                        	<p>
                            	Getting visa to enter a country is very important and you will lose much money if problem with your visa. We don't want any problem with your visa therefore we would like your visa request must be confirmed via email to make sure we all understand correctly regarding your visa request &amp; we will responsible for what we confirm you via email.
                        	</p>
                        	<p>
                            	Don't worry if you want to get your visa on Sat or Sun or Public holiday. We know how.
                        	</p>
                        	<p>
                            	Best regards,<br/>
                          		<strong>Visa-Vietnam.Org</strong><br/>
                        	</p>
                        </div>        
                   </div>
            		</div>
					<?php 
					if($_POST['btnSubmitUrgent']){
						$view = "";
						if($flagemail == -1){
							$view .= "primaryemail is empty.";
						}
						else if($flagemail == -2){
							echo "<script type='text/javascript'>alert(\"Primary email and re-typed email does not match.\");</script>";
						}
						if($flagreemail == -1){
							$view .= "reemail is empty.";	
						}
						if($flagfullname == -1){
							$view .= "fullname is empty.";
						}
						if($birth == -1){
							$view .= "dateofbirth is empty.";
						}
						if($passport == -1){
							$view .= "passport is empty.";
						}
						if($nationality == -1){
							$view .= "nationality is empty.";
						}
						if($flightdetails == -1){
							$view .= "flightdetails is empty.";
						}
						if($entry == -1){
							$view .= "dateofarrival is empty.";
						}
						echo "<script type='text/javascript'>alert(\"".$view."\");</script>";
					}
					else
					{ 
			?>
				<div class="contentpaneopen">
                    <div id="application">
                    	<form action="" id="fromApp1" method="post" name="frmAppl" >
                        	<input type="hidden" value="1" name="confirmed" />
                        	<input type="hidden" value="2" name="step" />
                        	<div id="app_form">
                            	<h2><span id="app_form_title">Urgent Visa</span></h2>
                            	<div id="app_form_text">
                                	Please fill the form below and click send if you need express visa for emergency trip to Vietnam. We will reply you at earliest time 24/7. Don't worry if you want to get your visa on Sat or Sun or Public holidy. We know how.<br/>
                            	</div>
                            	<div class="app_form_inner">                                                           
                                	<label class="">Primary Email <span style="color:#FF0000">*</span></label>
                                	<input type="text" class="" value="" name="primaryemail" id="primaryemail" />
                                	<label class="">Re-Type Primary Email <span style="color:#FF0000">*</span></label>
                                	<input type="text" class="" autocomplete="off" onpaste="alert('You cannot directly copy and paste.');this.value='';return false;" value="" name="reemail" id="reemail" />  
                                    <label>Secondary Email (optional)</label>
                                    <input type="text" value="" id="secondaryemail" name="secondaryemail" />            
                                    <label class="">Fullname (as in passport) <span style="color:#FF0000">*</span></label>
                                    <input type="text" class="" value="" id="fullname" name="fullname" />
                                    <label class="set">Date of Birth <span style="color:#FF0000">*</span></label>
                                    <input id="Date_of_Birth" class="DateofbirthMM ccf-datepicker-1 " name="Date_of_Birth" type="text" />
                                    <label>Passport Number <span style="color:#FF0000">*</span></label>      
                                    <input type="text" class="" value="" id="passport" name="passport" />         
                                    <label class="">Nationality <span style="color:#FF0000">*</span></label>
                                    <select class="national" id="nationality" name="nationality">
                                    	<option value="">&nbsp;</option>                                    
                                   	</select>       
                                    <label>Flight Details <span style="color:#FF0000">*</span></label>
                                    <input type="text" class="" value="" id="flightdetails" name="flightdetails" />         
                                    <label class="">Date of entry <span style="color:#FF0000">*</span></label>
                                    <input id="Date_of_Entry" class="DateofentryMM ccf-datepicker-1 " name="Date_of_Entry" type="text" />
                                    <label class="lamessage">Urgent message</label>       
                                    <textarea id="request" name="request"></textarea>        
                            	</div>
                                <div class="submit_form">
                                    <input type="submit" onclick="submitForm(1);" value="Submit &gt;&gt;" name="btnSubmitUrgent" class="button">
                                </div> 
                        	</div>
                        </form>
                        <div id="urgent_frame">
                        	<p>
                            	<em>
                                	<strong>Why we don't accept call for your visa?</strong>
                           		</em>
                        	</p>
                        	<p>
                            	Getting visa to enter a country is very important and you will lose much money if problem with your visa. We don't want any problem with your visa therefore we would like your visa request must be confirmed via email to make sure we all understand correctly regarding your visa request &amp; we will responsible for what we confirm you via email.
                        	</p>
                        	<p>
                            	Don't worry if you want to get your visa on Sat or Sun or Public holiday. We know how.
                        	</p>
                        	<p>
                            	Best regards,<br/>
                          		<strong>Visa-Vietnam.Org</strong><br/>
                        	</p>
                        </div>        
                   </div>
            	</div>
            	<?php
					}
					} 
            	?>
			</div><!-- #main_content_foot -->					
		</div><!-- #main_content -->

<?php get_footer(); ?>